// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

body;

// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.
beginstate LOAD_SCEN_STATE;

//Quests

	init_quest(0,"Slay the Dragon","Poulan's town council has asked you to locate the dragon attacking the valley and kill it.");
	init_quest(1,"Find Captain Terronez","Poulan's town council suggested that you seek help from Captain Terronez. He should be somewhere north of the bridge");
	init_quest(2,"Kill Dragonite Shaman","Captain Terronez has asked you to kill a dragonite shaman encamped in the northwest corner of the valley.");

//Special Items

	init_special_item(1,"Shaman's Key","This is a bone key you found on the body of the dragonite high shaman. It has draconic runes inscribed on it.");
	init_special_item(2,"Cell Key","This key goes to the holding cell in the war camp. It was given to you by the guard there.");

break;

// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.
beginstate START_SCEN_STATE;

	// Initialize a few shops.
	
	// Shop 0 - armor
	add_item_to_shop(0,25,25);
	add_item_to_shop(0,26,20);
	add_item_to_shop(0,30,20);
	add_item_to_shop(0,31,10);
	add_item_to_shop(0,35,10);
	add_item_to_shop(0,121,15);
	add_item_to_shop(0,122,15);
	add_item_to_shop(0,126,3);
	add_item_to_shop(0,131,2);
	add_item_to_shop(0,111,15);
	add_item_to_shop(0,16,10);
	add_item_to_shop(0,136,10);
	add_item_to_shop(0,137,10);
	add_item_to_shop(0,141,5);
	
	// Shop 1 - weapons
	add_item_to_shop(1,45,25);
	add_item_to_shop(1,46,20);
	add_item_to_shop(1,50,15);
	add_item_to_shop(1,51,10);
	add_item_to_shop(1,55,5);
	add_item_to_shop(1,65,20);
	add_item_to_shop(1,66,10);
	add_item_to_shop(1,70,5);
	
	// Shop 2 - tools
	add_item_to_shop(2,170,500);
	add_item_to_shop(2,171,500);
	add_item_to_shop(2,172,30);
	add_item_to_shop(2,174,500);
	add_item_to_shop(2,164,500);
	add_item_to_shop(2,177,500);
	add_item_to_shop(2,451,10);
	
	// Shop 3 - missiles
	add_item_to_shop(3,85,500);
	add_item_to_shop(3,86,10);
	add_item_to_shop(3,90,10);
	add_item_to_shop(3,95,3);
	add_item_to_shop(3,100,20);
	add_item_to_shop(3,101,10);
	add_item_to_shop(3,105,10);

	// Shop 4 - potions
	add_item_to_shop(4,220,4);
	add_item_to_shop(4,221,3);
	add_item_to_shop(4,222,3);
	add_item_to_shop(4,223,2);

	// Shop 5 - food
	add_item_to_shop(5,4,500);
	add_item_to_shop(5,5,500);
	add_item_to_shop(5,6,500);
	add_item_to_shop(5,7,500);
	add_item_to_shop(5,10,500);
	add_item_to_shop(5,11,500);
	add_item_to_shop(5,12,500);
	add_item_to_shop(5,399,500);
	add_item_to_shop(5,400,500);
	add_item_to_shop(5,455,500);

	// Shop 6 - roses
	add_item_to_shop(6,445,20);
break;

// This state is called every tick wherever the party is in the scenario.
// You can use the set_state

beginstate START_STATE;

//CREATURE LEVEL ADJUSTMENT
	set_creature_type_level(51,20);
	set_creature_type_level(52,25);
	set_creature_type_level(58,30);
	set_creature_type_level(84,25);

	if ((what_day_of_scenario() >= 1) && (get_flag(1,29) == 0))
		set_flag(1,29,1);

break;

// Place your own states below. Give each a number at least 10.

beginstate 10;
break;